package tda366.tilemap;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class TileMapController implements MouseListener{

	private TileMapView view;
	private TileMapModel model;
	
	public TileMapController(TileMapView view, TileMapModel model) {
		this.view = view;
		this.view.addMouseListener(this);
		this.model = model;
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		model.updateTileMap(e.getX()/20, e.getY()/20);
		view.repaint();
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
